<?php
error_reporting(E_ALL);
ini_set("display_errors", "on");
require_once '../include/common.php';
require_once DIR_ROOT.'./configs/common.php';
require_once DIR_ROOT.'./configs/db.php';

$query = $db->query("select count(1) from player_info where p_grade>0");

$row = mysql_fetch_array($query, MYSQL_NUM);
$valid_user=$row[0];

$query = $db->query("select count(1) from player_info where p_grade>-1");
$row = mysql_fetch_array($query, MYSQL_NUM);
$total_user=$row[0];

$query = $db->query("select count(u_id) from player_info where hour(TIMEDIFF(NOW(),FROM_UNIXTIME(`reg_time`,'%Y-%m-%d %H:%i:%s'))) <1");
$row = mysql_fetch_array($query, MYSQL_NUM);
$lasthour_user=$row[0];

$query = $db->query("select count(u_id) from player_info where hour(TIMEDIFF(NOW(),FROM_UNIXTIME(`reg_time`,'%Y-%m-%d %H:%i:%s'))) <1 and p_grade>0");
$row = mysql_fetch_array($query, MYSQL_NUM);
$lasthour_valid_user=$row[0];


echo "<pre>\n";
echo "valid_user:$valid_user\n";
echo "total_user:$total_user\n";
echo "lasthour_user:$lasthour_user\n";
echo "lasthour_valid_user:$lasthour_valid_user\n";
echo "</pre>";


?>